import {IListParams} from "@/api/types/common";
import request from "@/utils/request";
import {IChatMessage} from "@/api/types/chat";


// 获取组聊消息
export const queryMessage = (params: IListParams) => {
  return request<{
    total: number;
    rows: IChatMessage[];
  }>({
    method: 'GET',
    url: '/system/queryMessage',
    params
  })
}
// 刪除消息
export const deleteMessage = (params: string) => {
  return request({
    method: 'delete',
    url: '/system/deleteMessage/'+params
  })
}

// 获取群聊消息
export const queryMessageByGroup = (params: IListParams) => {
  return request<{
    total: number;
    rows: IChatMessage[];
  }>({
    method: 'GET',
    url: '/system/queryMessageByGroup',
    params
  })
}
// 刪除消息
export const deleteMessageByGroup = (params: string) => {
  return request({
    method: 'delete',
    url: '/system/deleteMessageByGroup/'+params
  })
}